﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace VirtualizingTreeView.Control
{
	public class BoolToVisibilityConverter : IValueConverter
	{
		public Object Convert( Object value, Type targetType, Object parameter, CultureInfo culture )
		{
		    return (Boolean) value ? Visibility.Visible : Visibility.Collapsed;
		}

	    public Object ConvertBack( Object value, Type targetType, Object parameter, CultureInfo culture )
		{
			return ( ( Visibility )value ) == Visibility.Visible;
		}
	}
}
